package com.zym.converter;


import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.ReadConverterContext;

/**
 * @author gabriel
 * @date 2022/9/7 14:51
 */
public class MyStringConverter implements Converter<String> {
    @Override
    public String convertToJavaData(ReadConverterContext<?> context) {
        String result = context.getReadCellData().getStringValue();
        try {
            Integer.parseInt(result);
        } catch (Exception e) {
            return "0";
        }
        return result;
    }
}
